import request from '@/config/axios'

// 分页查询题库
export const getCatStorePage = async (params: any) => {
  return await request.get({ url: '/system/catStore/page', params })
}

//题目列表
export const getCatStorePageQuery = async () => {
  return await request.get({ url: '/system/catStore/list' })
}

// 题库详情
export const getCatStoreDetail = async (id: number) => {
  return await request.post({ url: '/system/catStore/detail', params: { id } })
}

// 导入模板下载
export const downloadCatStoreTemplate = () => {
  return request.download({ url: '/system/catStore/download' })
}

// 获取导入地址
export const getImportUrl = () => {
  return import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/system/catStore/import'
}

// 删除题库
export const deleteCatStore = async (id: number) => {
  return await request.post({ url: '/system/catStore/delete', params: { id } })
}

// 更新题库（整体对象修改）
export const updateCatStore = async (data: any) => {
  return await request.post({ url: '/system/catStore/updateCatStore',params: { "id": data.id } ,data })
}


